import {getSummaryToday, getLastWeek, getLastWeekUsers, getUsers, getTodayData} from '@/api/todayDataApi'
const todayData = {
    namespaced: true,
    state: {
        roleList: []
    },
    getters: {
      
    },
    mutations: { 
    },
    actions: { 
        GetSummaryToday ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getSummaryToday(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetLastWeek ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getLastWeek(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetLastWeekUsers ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getLastWeekUsers(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetUsers ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getUsers(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetTodayData ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getTodayData(params).then(res => {
                    resolve(res)
                })
            })
        }
    }
}
export default todayData
